import statusApi from '@/api/declaration/crm/statusApi'
import httpRequest from '@/config/axios/httpRequest'
import { CrmStatusModel } from '@/models/crm/CrmStatusModel'


// 查询商机状态组列表
export const getBusinessStatusPage = async (params: any) => {
  return await httpRequest.get(statusApi.GetBusinessStatusPage, { params })
}

// 新增商机状态组
export const createBusinessStatus = async (data: CrmStatusModel) => {
  return await httpRequest.post(statusApi.CreateBusinessStatus, data)
}

// 修改商机状态组
export const updateBusinessStatus = async (data: CrmStatusModel) => {
  return await httpRequest.put(statusApi.UpdateBusinessStatus, data)
}

// 查询商机状态类型详情
export const getBusinessStatus = async (id: number) => {
  return await httpRequest.get(statusApi.GetBusinessStatus, { params: { id } })
}

// 删除商机状态
export const deleteBusinessStatus = async (id: number) => {
  return await httpRequest.delete(statusApi.DeleteBusinessStatus, { params: { id } })
}

// 获得商机状态组列表
export const getBusinessStatusTypeSimpleList = async () => {
  return await httpRequest.get(statusApi.GetBusinessStatusTypeSimpleList)
}

// 获得商机阶段列表
export const getBusinessStatusSimpleList = async (typeId: number) => {
  return await httpRequest.get(statusApi.GetBusinessStatusSimpleList, { params: { typeId } })
}
